package com.blank.shop.security;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * <br/>Date 2021/9/9
 * <br/>Time 18:15:09
 *
 * @author _blank
 */
@SpringBootApplication
public class SpringSecurityApplication {

    /*
     * org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
     *
     * Spring Security:
     * see https://docs.spring.io/spring-security/site/docs/5.3.9.RELEASE/reference/html5/
     * see https://github.com/spring-projects/spring-security
     *
     * Spring Boot Start Security:
     * see https://docs.spring.io/spring-boot/docs/2.3.12.RELEASE/reference/html/spring-boot-features.html#boot-features-security
     *
     * see https://github.com/spring-projects/spring-security-samples
     *
     * Spring Cloud Security:
     * see https://docs.spring.io/spring-cloud-security/docs/current/reference/html/
     *
     *
     *
     *  Spring Security基本原理 :
     *
     *    响应                                                       请求
     * org.springframework.security.web.context.SecurityContextPersistenceFilter
     *     ↑                                                          ↓
     * org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
     *     ↑                                                          ↓
     * org.springframework.security.web.authentication.www.BasicAuthenticationFilter
     *     ↑                                                          ↓
     * org.springframework.security.web.access.ExceptionTranslationFilter
     *     ↑                                                          ↓
     * org.springframework.security.web.access.intercept.FilterSecurityInterceptor
     *     ↑                                                          ↓
     * --------------------------你真正的rest api 服务--------------------------
     *
     *
     *
     * org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
     *     ↑                                                          ↓
     * org.springframework.security.authentication.AuthenticationManager
     * org.springframework.security.authentication.ProviderManager
     *     ↑                                                          ↓
     * org.springframework.security.authentication.AuthenticationProvider
     *     ↑                                                          ↓
     * org.springframework.security.core.userdetails.UserDetailsService
     *     ↑                                                          ↓
     * org.springframework.security.core.userdetails.UserDetails
     *     ↑                                                          ↓
     * org.springframework.security.core.Authentication
     *     ↑                                                          ↓
     * org.springframework.security.core.context.SecurityContext
     *     ↑                                                          ↓
     * org.springframework.security.core.context.SecurityContextHolder
     *     ↑                                                          ↓
     * org.springframework.security.web.context.SecurityContextPersistenceFilter
     */

    public static void main(String[] args) {
        SpringApplication.run(SpringSecurityApplication.class, args);
    }

}
